<div id="create_load_balancer_dialog">

 <div id="name_field" class="field">
   <div id="name_header">
     <%= t("dialog.create_load_balancer.header.display_name") %>
   </div>
   <div id="name_box">
     <input id="display_name" type="text" size="20" value="<%= @display_name %>"></td>
   </div>
 </div>

 <div id="description_field" class="field">
    <div id="description_header">
      <%= t("dialog.create_load_balancer.header.description") %>
    </div>
    <div id="description_box">
      <input type="text" id="description" size="69" value="<%= @description %>">
    </div>
  </div>

  <div id="load_balancer" class="field">
    <table border="1" class="setting_field">
    <tr>
      <th class="header" colspan="2"><%= t("dialog.create_load_balancer.header.load_balancer") %></th>
      <th class="header" colspan="2"><%= t("dialog.create_load_balancer.header.instance") %></th>
    </tr>
    <tr>
      <th class="header"><%= t("dialog.create_load_balancer.header.load_balancer_protocol") %></th>
      <th class="header"><%= t("dialog.create_load_balancer.header.load_balancer_port") %></th>
      <th class="header"><%= t("dialog.create_load_balancer.header.instance_protocol") %></th>
      <th class="header"><%= t("dialog.create_load_balancer.header.instance_port") %></th>
    </tr>
    <tr>
      <td>
      <%= select_tag(:load_balancer_protocol,
          options_for_select(['http', 'https','tcp','ssl'],
          @protocol))
      %>
      </td>
      <td>
        <input id="load_balancer_port" type="text" size="4" maxlength="5" value="<%= @port %>">
      </td>
      <td>
        <span id="instance_protocol"></span>
      </td>
      <td>
        <input id="instance_port" type="text" size="4" maxlength="5" value="<%= @instance_port %>">
      </td>
    </tr>
  </table>
  </div>

  <div id="balance_algorithm" class="field">
    <div id="balance_algorithm_header">
      <%= t("dialog.create_load_balancer.algorithm.header") %>
    </div>
    <div id="balance_algorithm_selector">
      <% @checked_leastonn = 'checked' if @balance_algorithm == 'leastconn' || @balance_algorithm.blank? %>
      <% @checked_source = 'checked' if @balance_algorithm == 'source' %>
      <label><input type="radio" name="balance_algorithm" value="leastconn" <%= @checked_leastonn  %>><%= t("dialog.create_load_balancer.algorithm.leastconnection") %></label>
      <label><input type="radio" name="balance_algorithm" value="source" <%= @checked_source %>><%= t("dialog.create_load_balancer.header.algorithm.source") %></label>
    </div>
  </div>

  <div id="certificate" class="field">
    <fieldset id="certificate_group">
      <legend><%= t("dialog.create_load_balancer.certificate.header") %></legend>
      <table class="setting_field" border="1">
      <tr>
         <td class="setting_title"><%= t("dialog.create_load_balancer.certificate.private_key") %></td>
      </tr>
      <tr>
         <td><textarea id="private_key" rows="3" cols="85"><%= @private_key %></textarea></td>
      </tr>
      <tr>
        <td class="setting_title"><%= t("dialog.create_load_balancer.certificate.public_key") %></td>
      </tr>
      <tr>
        <td><textarea id="public_key" rows="3" cols="85"><%= @public_key %></textarea></td>
      </tr>
      </table>
    </fieldset>
  </div>

  <div id="sticky_session" class="field">
    <fieldset id="sticky_session_group">
    <legend><input type="checkbox" id="use_sticky_session" <% if !@cookie_name.empty? %> checked <% end %>><%= t("dialog.create_load_balancer.sticky_session.header") %></legend>
    <table border="1" class="setting_field">
      <tr>
        <td class="setting_title"><%= t("dialog.create_load_balancer.sticky_session.cookie_name") %></td>
      </tr>
      <tr>
        <td><input id="cookie_name" type="text" size="38" value="<%= @cookie_name %>"></td>
      </tr>
    </table>
    </fieldset>
  </div>

</div>
